package net.ib.mtalk.database.task;

import net.ib.mntalk.protocol.Common.UUIDMsg;
import net.ib.mtalk.constant.HandlerMsgConst;
import net.ib.mtalk.database.helper.BuddyDatabaseHelper;
import net.ib.mtalk.ui.buddy.info.BuddyInfoActivity;
import android.content.Context;
import android.os.Handler;
import android.os.Message;

public class InsertFavoriteTask extends AsyncClientTask {
	private UUIDMsg mUUIDMsg;
	
	public InsertFavoriteTask(Context context, Handler uiHandler, UUIDMsg msg) {
		super(context, uiHandler);
		this.mUUIDMsg = msg;
	}

	@Override
	protected void onPostExecute(int resultCode, Object sentObject,	Object receivedObject) {
		BuddyDatabaseHelper.insertFavorite(mContext, mUUIDMsg);
		mUiHandler.sendMessageAtFrontOfQueue(mUiHandler.obtainMessage(HandlerMsgConst.HANDLER_INSERT_FAVORITE_SUCCESS));
	}
}
